<?php
include_once ('/../../dao_class/Ressource.php');
include_once ('/../../dao_class/RessourceDao.php');
include_once ('/../../dao_class/Datasource.php');
include_once ('/../../dao_class/UserDao.php');
include_once ('/../../dao_class/User.php');

#echo 'test';
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of loeschen
 *
 * @author Kamdem
 */
class loeschen {
   function delet(){
       
       $server = 'localhost';
        $dbname = 'ai-vas';
        $user = 'root';
        $password = '';
        
       
       if (!isset($_GET["id_ressource"]) || !is_numeric($_GET["id_ressource"])){
         die("Fehler");
            } else{
                  $conn = new Datasource($server, $dbname, $user, $password);
                  $RessourceDao = new RessourceDao();
                  $Ressource = $RessourceDao->getObject($conn, $_GET['id_ressource']);
                  #$Ressource = $RessourceDao->getObject($conn, $_GET['name']);
                  $RessourceDao->delete($conn, $Ressource);
                  
        
        echo ' <div> Die Datei ist geloescht</div>';
            }
    }
}

$delect = new loeschen();
$delect->delet();

?>
